<?php

namespace App\Http\Controllers\WebPage;


use App\Http\Controllers\Controller;
use App\Http\Models\Feedback;
use App\Http\Models\Video;
use App\Http\Models\VideoType;
use App\Http\Requests\WebPage\FeedBack\FeedBackRequest;
use App\Services\Utils\ApiResponser;
use App\Services\Utils\Transaction;
use Illuminate\Http\Request;

/**
 * 视频curd
 * Class VideoController
 * @package App\Http\Controllers\WebPage\Admin
 */
class FeedbackController extends Controller
{

    use ApiResponser;

    public function store(FeedBackRequest $request)
    {
        if ( trim($request->contents)=='' ) return ['code'=>1,'error'=>'反馈内容不能为空'];

       $create = Feedback::create([
            'content' => trim($request->contents),
            'company'     => $request->company,
            'contact_people' => $request->contact_people,
            'address'      => $request->address,
            'phone' => $request->phone,
            'intent_city' => $request->intent_city,
            'email' => $request->email,
        ]);

       return $this->response(compact('create'));

    }

}
